<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<img src="1.jpg" id="imgid">
</body>
<script type="text/javascript">
	
	imgobj=document.getElementById('imgid');
	i=0;
	imgobj.onclick=function(){
		if(i%2==0){
			this.src='3.jpg';
		}else{
			this.jpg='2.jpg';
		}
	      i++;
	}
</script>
</html>